#ifndef _BUOLA_MEDIA_AUDIO_BAUDIOTESTSRC_H_
#define _BUOLA_MEDIA_AUDIO_BAUDIOTESTSRC_H_

#include <buola/bbox/bservice.h>

#include <buola/bbox/bstreamout.h>

namespace buola { namespace media {

class BAudioTestSrc : public bbox::BService<BAudioTestSrc>
{
public:
    enum class EWave
    {
        SINE,
        SQUARE,
        SAW,
        TRIANGLE,
        SILENCE,
        WHITE_NOISE,
        TICKS,
        GAUSSIAN_WHITE_NOISE
    };

public:
    BAudioTestSrc();

    void CreateBuffer();

private:
    EWave mWaveType;
    double mVolume;
    double mFreq;

    double mSampleRate;
    int64_t mSamplesPerBuffer;
    int64_t mSampleSize;

    int64_t mNextSample;

public:
    bbox::BStreamOut<int16_t> oWave;
};

/*namespace media*/ } /*namespace buola*/ }

#endif
